package ThreadTest.SaleTicket;
/*
售卖车票的线程
 */
public class SaleTicketThread extends Thread{
    Ticket ticket;
    public SaleTicketThread(Ticket ticket){
        this.ticket = ticket;
    }

    public void run(){

        while(true){
            try {
                //循环卖出车票
                ticket.saleTicket();
            } catch (NullTicketException e) {
                System.out.println(e.getMessage());
                break;
            }
        }
    }
}
